package org.admanager.scamapping.plugin.scamapping.diagram.navigator;

import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.Component2EditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.Component3EditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.ComponentEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.ComponentMappingEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.ComponentMappingSourceEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.ComponentMappingTargetEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.ComponentName2EditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.ComponentName3EditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.ComponentNameEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.ComponentReference2EditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.ComponentReference3EditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.ComponentReferenceEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.ComponentReferenceMappingEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.ComponentReferenceMappingSourceEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.ComponentReferenceMappingTargetEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.ComponentService2EditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.ComponentService3EditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.ComponentServiceEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.ComponentServiceMappingEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.ComponentServiceMappingSourceEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.ComponentServiceMappingTargetEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.Composite2EditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.CompositeEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.CompositeMappingEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.CompositeMappingSourceEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.CompositeMappingTargetEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.CompositeName2EditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.CompositeNameEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.DocumentRootEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.DocumentRootNameEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.PatternEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.PatternNameEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.Reference2EditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.ReferenceEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.ReferenceMappingEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.ReferenceMappingSourceEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.ReferenceMappingTargetEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.RootMappingEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.Service2EditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.ServiceEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.ServiceMappingEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.ServiceMappingSourceEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.parts.ServiceMappingTargetEditPart;
import org.admanager.scamapping.plugin.scamapping.diagram.part.MappingDiagramEditorPlugin;
import org.admanager.scamapping.plugin.scamapping.diagram.part.MappingVisualIDRegistry;
import org.admanager.scamapping.plugin.scamapping.diagram.providers.MappingElementTypes;
import org.admanager.scamapping.plugin.scamapping.diagram.providers.MappingParserProvider;
import org.admanager.simplifiedsca.plugin.simplifiedsca.ComponentReference;
import org.admanager.simplifiedsca.plugin.simplifiedsca.Reference;
import org.admanager.simplifiedsca.plugin.simplifiedsca.Service;
import org.admanager.soageneralpattern.plugin.soageneralpattern.ComponentService;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.jface.viewers.ITreePathLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.ViewerLabel;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.navigator.ICommonContentExtensionSite;
import org.eclipse.ui.navigator.ICommonLabelProvider;

/**
 * @generated
 */
public class MappingNavigatorLabelProvider extends LabelProvider implements
		ICommonLabelProvider, ITreePathLabelProvider {

	/**
	 * @generated
	 */
	static {
		MappingDiagramEditorPlugin
				.getInstance()
				.getImageRegistry()
				.put("Navigator?UnknownElement", ImageDescriptor.getMissingImageDescriptor()); //$NON-NLS-1$
		MappingDiagramEditorPlugin
				.getInstance()
				.getImageRegistry()
				.put("Navigator?ImageNotFound", ImageDescriptor.getMissingImageDescriptor()); //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	public void updateLabel(ViewerLabel label, TreePath elementPath) {
		Object element = elementPath.getLastSegment();
		if (element instanceof MappingNavigatorItem
				&& !isOwnView(((MappingNavigatorItem) element).getView())) {
			return;
		}
		label.setText(getText(element));
		label.setImage(getImage(element));
	}

	/**
	 * @generated
	 */
	public Image getImage(Object element) {
		if (element instanceof MappingNavigatorGroup) {
			MappingNavigatorGroup group = (MappingNavigatorGroup) element;
			return MappingDiagramEditorPlugin.getInstance().getBundledImage(
					group.getIcon());
		}

		if (element instanceof MappingNavigatorItem) {
			MappingNavigatorItem navigatorItem = (MappingNavigatorItem) element;
			if (!isOwnView(navigatorItem.getView())) {
				return super.getImage(element);
			}
			return getImage(navigatorItem.getView());
		}

		// Due to plugin.xml content will be called only for "own" views
		if (element instanceof IAdaptable) {
			View view = (View) ((IAdaptable) element).getAdapter(View.class);
			if (view != null && isOwnView(view)) {
				return getImage(view);
			}
		}

		return super.getImage(element);
	}

	/**
	 * @generated
	 */
	public Image getImage(View view) {
		switch (MappingVisualIDRegistry.getVisualID(view)) {
		case ServiceMappingSourceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://scamapping/1.0?ServiceMapping?source", MappingElementTypes.ServiceMappingSource_4002); //$NON-NLS-1$
		case CompositeMappingEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://scamapping/1.0?CompositeMapping", MappingElementTypes.CompositeMapping_2003); //$NON-NLS-1$
		case ServiceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://simplifiedsca/1.0?Service", MappingElementTypes.Service_3005); //$NON-NLS-1$
		case ComponentReferenceMappingEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://scamapping/1.0?ComponentReferenceMapping", MappingElementTypes.ComponentReferenceMapping_2001); //$NON-NLS-1$
		case ComponentServiceMappingSourceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://scamapping/1.0?ComponentServiceMapping?source", MappingElementTypes.ComponentServiceMappingSource_4008); //$NON-NLS-1$
		case ComponentServiceMappingEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://scamapping/1.0?ComponentServiceMapping", MappingElementTypes.ComponentServiceMapping_2002); //$NON-NLS-1$
		case ReferenceMappingSourceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://scamapping/1.0?ReferenceMapping?source", MappingElementTypes.ReferenceMappingSource_4005); //$NON-NLS-1$
		case ComponentReferenceMappingTargetEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://scamapping/1.0?ComponentReferenceMapping?target", MappingElementTypes.ComponentReferenceMappingTarget_4009); //$NON-NLS-1$
		case ComponentMappingTargetEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://scamapping/1.0?ComponentMapping?target", MappingElementTypes.ComponentMappingTarget_4006); //$NON-NLS-1$
		case ComponentMappingSourceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://scamapping/1.0?ComponentMapping?source", MappingElementTypes.ComponentMappingSource_4007); //$NON-NLS-1$
		case CompositeMappingSourceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://scamapping/1.0?CompositeMapping?source", MappingElementTypes.CompositeMappingSource_4011); //$NON-NLS-1$
		case Service2EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://soageneralpattern/1.0?Service", MappingElementTypes.Service_3014); //$NON-NLS-1$
		case ReferenceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://simplifiedsca/1.0?Reference", MappingElementTypes.Reference_3006); //$NON-NLS-1$
		case ComponentEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://simplifiedsca/1.0?Component", MappingElementTypes.Component_3002); //$NON-NLS-1$
		case ServiceMappingTargetEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://scamapping/1.0?ServiceMapping?target", MappingElementTypes.ServiceMappingTarget_4003); //$NON-NLS-1$
		case ComponentService3EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://soageneralpattern/1.0?ComponentService", MappingElementTypes.ComponentService_3012); //$NON-NLS-1$
		case CompositeEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://simplifiedsca/1.0?Composite", MappingElementTypes.Composite_3001); //$NON-NLS-1$
		case RootMappingEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Diagram?http://scamapping/1.0?RootMapping", MappingElementTypes.RootMapping_1000); //$NON-NLS-1$
		case ServiceMappingEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://scamapping/1.0?ServiceMapping", MappingElementTypes.ServiceMapping_2005); //$NON-NLS-1$
		case Component2EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://soageneralpattern/1.0?Component", MappingElementTypes.Component_3007); //$NON-NLS-1$
		case Reference2EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://soageneralpattern/1.0?Reference", MappingElementTypes.Reference_3015); //$NON-NLS-1$
		case ReferenceMappingEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://scamapping/1.0?ReferenceMapping", MappingElementTypes.ReferenceMapping_2006); //$NON-NLS-1$
		case ComponentReferenceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://simplifiedsca/1.0?ComponentReference", MappingElementTypes.ComponentReference_3003); //$NON-NLS-1$
		case ComponentReferenceMappingSourceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://scamapping/1.0?ComponentReferenceMapping?source", MappingElementTypes.ComponentReferenceMappingSource_4010); //$NON-NLS-1$
		case DocumentRootEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://simplifiedsca/1.0?DocumentRoot", MappingElementTypes.DocumentRoot_2008); //$NON-NLS-1$
		case ComponentServiceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://simplifiedsca/1.0?ComponentService", MappingElementTypes.ComponentService_3004); //$NON-NLS-1$
		case Composite2EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://soageneralpattern/1.0?Composite", MappingElementTypes.Composite_3010); //$NON-NLS-1$
		case PatternEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://soageneralpattern/1.0?Pattern", MappingElementTypes.Pattern_2009); //$NON-NLS-1$
		case ReferenceMappingTargetEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://scamapping/1.0?ReferenceMapping?target", MappingElementTypes.ReferenceMappingTarget_4004); //$NON-NLS-1$
		case CompositeMappingTargetEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://scamapping/1.0?CompositeMapping?target", MappingElementTypes.CompositeMappingTarget_4001); //$NON-NLS-1$
		case ComponentMappingEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://scamapping/1.0?ComponentMapping", MappingElementTypes.ComponentMapping_2004); //$NON-NLS-1$
		case ComponentService2EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://soageneralpattern/1.0?ComponentService", MappingElementTypes.ComponentService_3008); //$NON-NLS-1$
		case ComponentReference2EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://soageneralpattern/1.0?ComponentReference", MappingElementTypes.ComponentReference_3009); //$NON-NLS-1$
		case ComponentServiceMappingTargetEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://scamapping/1.0?ComponentServiceMapping?target", MappingElementTypes.ComponentServiceMappingTarget_4012); //$NON-NLS-1$
		case ComponentReference3EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://soageneralpattern/1.0?ComponentReference", MappingElementTypes.ComponentReference_3013); //$NON-NLS-1$
		case Component3EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://soageneralpattern/1.0?Component", MappingElementTypes.Component_3011); //$NON-NLS-1$
		}
		return getImage("Navigator?UnknownElement", null); //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private Image getImage(String key, IElementType elementType) {
		ImageRegistry imageRegistry = MappingDiagramEditorPlugin.getInstance()
				.getImageRegistry();
		Image image = imageRegistry.get(key);
		if (image == null && elementType != null
				&& MappingElementTypes.isKnownElementType(elementType)) {
			image = MappingElementTypes.getImage(elementType);
			imageRegistry.put(key, image);
		}

		if (image == null) {
			image = imageRegistry.get("Navigator?ImageNotFound"); //$NON-NLS-1$
			imageRegistry.put(key, image);
		}
		return image;
	}

	/**
	 * @generated
	 */
	public String getText(Object element) {
		if (element instanceof MappingNavigatorGroup) {
			MappingNavigatorGroup group = (MappingNavigatorGroup) element;
			return group.getGroupName();
		}

		if (element instanceof MappingNavigatorItem) {
			MappingNavigatorItem navigatorItem = (MappingNavigatorItem) element;
			if (!isOwnView(navigatorItem.getView())) {
				return null;
			}
			return getText(navigatorItem.getView());
		}

		// Due to plugin.xml content will be called only for "own" views
		if (element instanceof IAdaptable) {
			View view = (View) ((IAdaptable) element).getAdapter(View.class);
			if (view != null && isOwnView(view)) {
				return getText(view);
			}
		}

		return super.getText(element);
	}

	/**
	 * @generated
	 */
	public String getText(View view) {
		if (view.getElement() != null && view.getElement().eIsProxy()) {
			return getUnresolvedDomainElementProxyText(view);
		}
		switch (MappingVisualIDRegistry.getVisualID(view)) {
		case ServiceMappingSourceEditPart.VISUAL_ID:
			return getServiceMappingSource_4002Text(view);
		case CompositeMappingEditPart.VISUAL_ID:
			return getCompositeMapping_2003Text(view);
		case ServiceEditPart.VISUAL_ID:
			return getService_3005Text(view);
		case ComponentReferenceMappingEditPart.VISUAL_ID:
			return getComponentReferenceMapping_2001Text(view);
		case ComponentServiceMappingSourceEditPart.VISUAL_ID:
			return getComponentServiceMappingSource_4008Text(view);
		case ComponentServiceMappingEditPart.VISUAL_ID:
			return getComponentServiceMapping_2002Text(view);
		case ReferenceMappingSourceEditPart.VISUAL_ID:
			return getReferenceMappingSource_4005Text(view);
		case ComponentReferenceMappingTargetEditPart.VISUAL_ID:
			return getComponentReferenceMappingTarget_4009Text(view);
		case ComponentMappingTargetEditPart.VISUAL_ID:
			return getComponentMappingTarget_4006Text(view);
		case ComponentMappingSourceEditPart.VISUAL_ID:
			return getComponentMappingSource_4007Text(view);
		case CompositeMappingSourceEditPart.VISUAL_ID:
			return getCompositeMappingSource_4011Text(view);
		case Service2EditPart.VISUAL_ID:
			return getService_3014Text(view);
		case ReferenceEditPart.VISUAL_ID:
			return getReference_3006Text(view);
		case ComponentEditPart.VISUAL_ID:
			return getComponent_3002Text(view);
		case ServiceMappingTargetEditPart.VISUAL_ID:
			return getServiceMappingTarget_4003Text(view);
		case ComponentService3EditPart.VISUAL_ID:
			return getComponentService_3012Text(view);
		case CompositeEditPart.VISUAL_ID:
			return getComposite_3001Text(view);
		case RootMappingEditPart.VISUAL_ID:
			return getRootMapping_1000Text(view);
		case ServiceMappingEditPart.VISUAL_ID:
			return getServiceMapping_2005Text(view);
		case Component2EditPart.VISUAL_ID:
			return getComponent_3007Text(view);
		case Reference2EditPart.VISUAL_ID:
			return getReference_3015Text(view);
		case ReferenceMappingEditPart.VISUAL_ID:
			return getReferenceMapping_2006Text(view);
		case ComponentReferenceEditPart.VISUAL_ID:
			return getComponentReference_3003Text(view);
		case ComponentReferenceMappingSourceEditPart.VISUAL_ID:
			return getComponentReferenceMappingSource_4010Text(view);
		case DocumentRootEditPart.VISUAL_ID:
			return getDocumentRoot_2008Text(view);
		case ComponentServiceEditPart.VISUAL_ID:
			return getComponentService_3004Text(view);
		case Composite2EditPart.VISUAL_ID:
			return getComposite_3010Text(view);
		case PatternEditPart.VISUAL_ID:
			return getPattern_2009Text(view);
		case ReferenceMappingTargetEditPart.VISUAL_ID:
			return getReferenceMappingTarget_4004Text(view);
		case CompositeMappingTargetEditPart.VISUAL_ID:
			return getCompositeMappingTarget_4001Text(view);
		case ComponentMappingEditPart.VISUAL_ID:
			return getComponentMapping_2004Text(view);
		case ComponentService2EditPart.VISUAL_ID:
			return getComponentService_3008Text(view);
		case ComponentReference2EditPart.VISUAL_ID:
			return getComponentReference_3009Text(view);
		case ComponentServiceMappingTargetEditPart.VISUAL_ID:
			return getComponentServiceMappingTarget_4012Text(view);
		case ComponentReference3EditPart.VISUAL_ID:
			return getComponentReference_3013Text(view);
		case Component3EditPart.VISUAL_ID:
			return getComponent_3011Text(view);
		}
		return getUnknownElementText(view);
	}

	/**
	 * @generated
	 */
	private String getServiceMappingSource_4002Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getCompositeMapping_2003Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getService_3005Text(View view) {
		Service domainModelElement = (Service) view.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			MappingDiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 3005); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getComponentReferenceMapping_2001Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getComponentServiceMappingSource_4008Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getComponentServiceMapping_2002Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getReferenceMappingSource_4005Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getComponentReferenceMappingTarget_4009Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getComponentMappingTarget_4006Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getComponentMappingSource_4007Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getCompositeMappingSource_4011Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getService_3014Text(View view) {
		org.admanager.soageneralpattern.plugin.soageneralpattern.Service domainModelElement = (org.admanager.soageneralpattern.plugin.soageneralpattern.Service) view
				.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			MappingDiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 3014); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getReference_3006Text(View view) {
		Reference domainModelElement = (Reference) view.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			MappingDiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 3006); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getComponent_3002Text(View view) {
		IParser parser = MappingParserProvider.getParser(
				MappingElementTypes.Component_3002,
				view.getElement() != null ? view.getElement() : view,
				MappingVisualIDRegistry
						.getType(ComponentNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			MappingDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5003); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getServiceMappingTarget_4003Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getComponentService_3012Text(View view) {
		ComponentService domainModelElement = (ComponentService) view
				.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			MappingDiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 3012); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getComposite_3001Text(View view) {
		IParser parser = MappingParserProvider.getParser(
				MappingElementTypes.Composite_3001,
				view.getElement() != null ? view.getElement() : view,
				MappingVisualIDRegistry
						.getType(CompositeNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			MappingDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5006); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getRootMapping_1000Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getServiceMapping_2005Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getComponent_3007Text(View view) {
		IParser parser = MappingParserProvider.getParser(
				MappingElementTypes.Component_3007,
				view.getElement() != null ? view.getElement() : view,
				MappingVisualIDRegistry
						.getType(ComponentName2EditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			MappingDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5010); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getReference_3015Text(View view) {
		org.admanager.soageneralpattern.plugin.soageneralpattern.Reference domainModelElement = (org.admanager.soageneralpattern.plugin.soageneralpattern.Reference) view
				.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			MappingDiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 3015); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getReferenceMapping_2006Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getComponentReference_3003Text(View view) {
		ComponentReference domainModelElement = (ComponentReference) view
				.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			MappingDiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 3003); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getComponentReferenceMappingSource_4010Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getDocumentRoot_2008Text(View view) {
		IParser parser = MappingParserProvider.getParser(
				MappingElementTypes.DocumentRoot_2008,
				view.getElement() != null ? view.getElement() : view,
				MappingVisualIDRegistry
						.getType(DocumentRootNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			MappingDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5007); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getComponentService_3004Text(View view) {
		org.admanager.simplifiedsca.plugin.simplifiedsca.ComponentService domainModelElement = (org.admanager.simplifiedsca.plugin.simplifiedsca.ComponentService) view
				.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			MappingDiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 3004); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getComposite_3010Text(View view) {
		IParser parser = MappingParserProvider.getParser(
				MappingElementTypes.Composite_3010,
				view.getElement() != null ? view.getElement() : view,
				MappingVisualIDRegistry
						.getType(CompositeName2EditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			MappingDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5016); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getPattern_2009Text(View view) {
		IParser parser = MappingParserProvider.getParser(
				MappingElementTypes.Pattern_2009,
				view.getElement() != null ? view.getElement() : view,
				MappingVisualIDRegistry.getType(PatternNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			MappingDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5017); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getReferenceMappingTarget_4004Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getCompositeMappingTarget_4001Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getComponentMapping_2004Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getComponentService_3008Text(View view) {
		ComponentService domainModelElement = (ComponentService) view
				.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			MappingDiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 3008); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getComponentReference_3009Text(View view) {
		org.admanager.soageneralpattern.plugin.soageneralpattern.ComponentReference domainModelElement = (org.admanager.soageneralpattern.plugin.soageneralpattern.ComponentReference) view
				.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			MappingDiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 3009); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getComponentServiceMappingTarget_4012Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getComponentReference_3013Text(View view) {
		org.admanager.soageneralpattern.plugin.soageneralpattern.ComponentReference domainModelElement = (org.admanager.soageneralpattern.plugin.soageneralpattern.ComponentReference) view
				.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			MappingDiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 3013); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getComponent_3011Text(View view) {
		IParser parser = MappingParserProvider.getParser(
				MappingElementTypes.Component_3011,
				view.getElement() != null ? view.getElement() : view,
				MappingVisualIDRegistry
						.getType(ComponentName3EditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			MappingDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5013); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getUnknownElementText(View view) {
		return "<UnknownElement Visual_ID = " + view.getType() + ">"; //$NON-NLS-1$  //$NON-NLS-2$
	}

	/**
	 * @generated
	 */
	private String getUnresolvedDomainElementProxyText(View view) {
		return "<Unresolved domain element Visual_ID = " + view.getType() + ">"; //$NON-NLS-1$  //$NON-NLS-2$
	}

	/**
	 * @generated
	 */
	public void init(ICommonContentExtensionSite aConfig) {
	}

	/**
	 * @generated
	 */
	public void restoreState(IMemento aMemento) {
	}

	/**
	 * @generated
	 */
	public void saveState(IMemento aMemento) {
	}

	/**
	 * @generated
	 */
	public String getDescription(Object anElement) {
		return null;
	}

	/**
	 * @generated
	 */
	private boolean isOwnView(View view) {
		return RootMappingEditPart.MODEL_ID.equals(MappingVisualIDRegistry
				.getModelID(view));
	}

}
